<template>
    <el-drawer v-model="drawer" :size="width">
        <template #header>
            <h4>
                <slot name="title"></slot>
            </h4>
        </template>
        <template #default>
            <slot name="main"></slot>
        </template>
        <template #footer>
            <div style="flex: auto">
                <el-button type="primary" @click="$emit('submitHandler')">提交</el-button>
                <el-button type="default" @click="$emit('qvxiao')">取消</el-button>
            </div>
        </template>
    </el-drawer>
</template>
<script setup lang='ts'>
import { ref, reactive, onMounted } from 'vue'

// 抽屉开关
const drawer = ref(false)

defineProps({
    width : Number || String
})

const openDrawer = () => drawer.value = true
const closeDrawer = () => drawer.value = false

defineEmits(['submitHandler','qvxiao'])

defineExpose({
    openDrawer,
    closeDrawer
})
</script>
<style scoped lang='scss'></style>